package com.dp.vo;

import java.io.Serializable;

import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Table;

@Entity
@Table(name = "news_group_sn")
public class NewsGroupSn implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected NewsGroupSnPK newsGroupSnPK;

    public NewsGroupSn() {
    }

    public NewsGroupSn(NewsGroupSnPK newsGroupSnPK) {
        this.newsGroupSnPK = newsGroupSnPK;
    }

    public NewsGroupSn(String sn, Integer groupid) {
        this.newsGroupSnPK = new NewsGroupSnPK(sn,groupid);
    }

	public NewsGroupSnPK getNewsGroupSnPK() {
		return newsGroupSnPK;
	}

	public void setNewsGroupSnPK(NewsGroupSnPK newsGroupSnPK) {
		this.newsGroupSnPK = newsGroupSnPK;
	}

	@Override
    public int hashCode() {
        int hash = 0;
        hash += (newsGroupSnPK != null ? newsGroupSnPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof NewsGroupSn)) {
            return false;
        }
        NewsGroupSn other = (NewsGroupSn) object;
        if ((this.newsGroupSnPK == null && other.newsGroupSnPK != null) || (this.newsGroupSnPK != null && !this.newsGroupSnPK.equals(other.newsGroupSnPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.dp.vo.NewsGroupSn[newsGroupSnPK=" + newsGroupSnPK + "]";
    }
	    
}
